package com.ruoyi.back.v1.domain

import com.baomidou.mybatisplus.annotation.IdType
import com.baomidou.mybatisplus.annotation.TableField
import com.baomidou.mybatisplus.annotation.TableId
import com.baomidou.mybatisplus.annotation.TableName
import io.swagger.annotations.ApiModel
import io.swagger.annotations.ApiModelProperty
import java.util.*
import javax.persistence.*


@TableName("fly_freeze_time")
@ApiModel("冻结时间")
@Table(name = "fly_freeze_time")
@Entity
data class FreezeTime(

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @TableId(type = IdType.AUTO)
    var id: Long? = null,

    @ApiModelProperty("冻结时间(天)")
    var time: Int? = null,

    @ApiModelProperty("冻结时间描述")
    var timeDesc: String? = null,

    var orderNum: Int? = null,
)

@ApiModel("冻结用户参数")
data class FreezeUserParam(

    @ApiModelProperty("用户id")
    var userId: Int? = null,

    @ApiModelProperty("冻结时间")
    var freezeTimeId: Long? = null,

    @ApiModelProperty("冻结原因")
    var freezeReason: String? = null,
)


@TableName("fly_login_log")
@ApiModel("登录日志")
@Table(name = "fly_login_log")
@Entity
data class LoginLog(

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @TableId(type = IdType.AUTO)
    var id: Long? = null,

    @ApiModelProperty("1.登录 2.登出")
    var operType: Int? = null,

    @ApiModelProperty("时间")
    var createTime: Date? = Date(),

    @ApiModelProperty("ip")
    var ipStr: String? = null,

    @ApiModelProperty("端口号")
    var port: Int? = 8888,

    @ApiModelProperty("用户id")
    var userId: Long? = null,
)


@TableName("fly_free_member")
@ApiModel("免费领会员")
@Table(name = "fly_free_member")
@Entity
data class FreeMember(

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @TableId(type = IdType.AUTO)
    var id: Long? = null,

    @ApiModelProperty("任务名称")
    var name: String? = null,

    @ApiModelProperty("会员介绍")
    var memberInstruct: String? = null,

    @ApiModelProperty("邀请注册人数")
    var inviteNum: Int? = 0,

    @ApiModelProperty("有效期")
    var durationTime: Int? = null,

    @ApiModelProperty("有效期单位 1.天 2.月 3.年")
    var durationUnit: Int? = null,

    @ApiModelProperty("换脸点数")
    var changeFacePoint: Int? = null,

    @ApiModelProperty("视频长度限制")
    var durationLimit: Int? = null,

    @ApiModelProperty("是否显示")
    var memberShow: Boolean? = true,

    @ApiModelProperty("创建时间")
    var createTime: Date? = Date()
)


@TableName("fly_free_member_share")
@ApiModel("免费会员分享")
@Table(name = "fly_free_member_share")
@Entity
data class FreeMemberShare(

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @TableId(type = IdType.AUTO)
    var id: Long? = null,

    @ApiModelProperty("分享标题")
    var title: String? = null,

    @ApiModelProperty("分享内容")
    var content: String? = null,

    @ApiModelProperty("分享图片")
    var pic: String? = null,

    @ApiModelProperty("分享链接")
    var url: String? = null,
)

@TableName("fly_point_detail")
@ApiModel("点数消耗详情")
@Table(name = "fly_point_detail")
@Entity
data class PointUseDetail(

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @TableId(type = IdType.AUTO)
    var id: Long? = null,

    @ApiModelProperty("类型 1.视频 2.图片")
    var type: Int? = null,

    @ApiModelProperty("每多少")
    var everyTime: Int? = null,

    @ApiModelProperty("消耗多少点")
    var usePoint: Int? = null,

    @ApiModelProperty("是否取整")
    var timeRound: Boolean? = false,
)

@TableName("fly_global_param_detail")
@ApiModel("公用参数详情")
@Table(name = "fly_global_param_detail")
@Entity
data class GlobalParamDetail(

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @TableId(type = IdType.AUTO)
    var id: Long? = null,

    @ApiModelProperty("自动审核")
    var autoCheck: Boolean = false,

    @ApiModelProperty("图片换脸接口 1.阿里 2.火山")
    var picChangeFace: Int? = 1,

    @ApiModelProperty("视频换脸接口 0.自动 1.阿里 2.火山")
    var videoChangeFace: Int? = 0,

    )

@TableName("fly_change_face_api_detail")
@ApiModel("换脸接口详情")
@Table(name = "fly_change_face_api_detail")
@Entity
data class ChangeFaceApiDetail(

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @TableId(type = IdType.AUTO)
    var id: Long? = null,

    @ApiModelProperty("换脸类型 1.图片 2.视频")
    var changeFaceType: Int? = null,

    @ApiModelProperty("换脸接口类型 1.阿里 2.火山")
    var changeFaceApiType: Int? = null,

    @ApiModelProperty("总共时长 s")
    var totalDuration: Long? = 0,

    @ApiModelProperty("年")
    var year: Int? = null,

    @ApiModelProperty("月")
    var month: Int? = null,

    @ApiModelProperty("日")
    var day: Int? = null,

    @ApiModelProperty("创建时间")
    var createTime: Date? = Date(),

    @ApiModelProperty("创建人")
    var userId: Long? = null,

    @TableField(exist = false)
    @Transient
    var formatDate: String? = null,
)

@TableName("fly_invite_user_detail")
@ApiModel("邀请用户详情")
@Table(name = "fly_invite_user_detail")
@Entity
data class InviteUserDetail(

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @TableId(type = IdType.AUTO)
    var id: Long? = null,

    @ApiModelProperty("被邀请得用户")
    var inviteUser: Long? = null,

    @ApiModelProperty("邀请人")
    var userId: Long? = null,

    @ApiModelProperty("绑定任务id")
    var taskId: Long? = null,
)

@TableName("fly_receive_task_detail")
@ApiModel("领取任务详情")
@Table(name = "fly_receive_task_detail")
@Entity
data class ReceiveTaskDetail(

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @TableId(type = IdType.AUTO)
    var id: Long? = null,

    @ApiModelProperty("用户id")
    var userId: Long? = null,

    @ApiModelProperty("任务id")
    var taskId: Long? = null,
)


@ApiModel("接口统计查询参数")
data class ApiStatisticsDto(

    @ApiModelProperty("日期类型 1.今日 2.昨日 3.近7日 4.近30日 5.全部")
    var type: Int? = 1,

    @ApiModelProperty("开始时间")
    var beginDate: String? = null,

    @ApiModelProperty("结束时间")
    var endDate: String? = null,
)


@ApiModel("接口统计数据")
data class ApiStatisticsVo(

    @ApiModelProperty("日期")
    var date: String? = "总计",

    @ApiModelProperty("图片换脸阿里次数")
    var picChangeFaceAliCount: Int? = 0,

    @ApiModelProperty("图片换脸火山次数")
    var picChangeFaceHuoshanCount: Int? = 0,

    @ApiModelProperty("视频换脸阿里次数")
    var videoChangeFaceAliCount: Int? = 0,

    @ApiModelProperty("视频换脸火山次数")
    var videoChangeFaceHuoshanCount: Int? = 0,

    @ApiModelProperty("视频换脸阿里时长")
    var videoChangeFaceAliDuration: String? = null,

    @ApiModelProperty("视频换脸火山时长")
    var videoChangeFaceHuoshanDuration: String? = null,
)

@ApiModel("接口总统计次数")
data class ApiTotalStatisticsVo(

    @ApiModelProperty("图片换脸阿里次数")
    var picChangeFaceAliCount: Int? = 0,

    @ApiModelProperty("图片换脸火山次数")
    var picChangeFaceHuoshanCount: Int? = 0,

    @ApiModelProperty("视频换脸阿里次数")
    var videoChangeFaceAliCount: Int? = 0,

    @ApiModelProperty("视频换脸火山次数")
    var videoChangeFaceHuoshanCount: Int? = 0,
)

@ApiModel("冻结用户信息")
data class FreezeUserInfo(

    @ApiModelProperty("用户id")
    var userId: Long? = null,

    @ApiModelProperty("冻结期限")
    var freezeLimit: String? = null,

    @ApiModelProperty("解冻日期")
    var unFreezeDate: String? = null,

    @ApiModelProperty("冻结原因")
    var freezeReason: String? = null,
)


